<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:91:"D:\phpStudy\PHPTutorial\WWW\xbs22\fly\public/../application/admin\view\admin_role\edit.html";i:1542611070;s:72:"D:\phpStudy\PHPTutorial\WWW\xbs22\fly\application\admin\view\layout.html";i:1542336746;}*/ ?>
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台登录-X-admin2.0</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	<link rel="stylesheet" href="/static/admin/css/font.css">
	<link rel="stylesheet" href="/static/admin/css/xadmin.css">
	<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
</head>
<body>
<div class="x-body">
	<form action="" method="post" class="layui-form layui-form-pane">
		<div class="layui-form-item">
			<label for="name" class="layui-form-label">
				<span class="x-red">*</span>角色名
			</label>
			<div class="layui-input-inline">
				<input type="text" id="name" name="name" required="" lay-verify="required"
					   autocomplete="off" class="layui-input" value="<?php echo $authRole['role_name']; ?>" disabled>
			</div>
		</div>
		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">
				拥有权限
			</label>
			<table class="layui-table layui-input-block">
				<tbody>
				<?php if(is_array($cate) || $cate instanceof \think\Collection || $cate instanceof \think\Paginator): $i = 0; $__LIST__ = $cate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$row): $mod = ($i % 2 );++$i;?>
				<tr>
					<td>
						<input type="checkbox" name="like1[write]" lay-skin="primary" title="<?php echo $row['rule_cate_name']; ?>">
						<div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span></span><i class="layui-icon"></i></div>
					</td>
					<td>
						<div class="layui-input-block">
							<input name="id[]" lay-skin="primary" type="checkbox" title="用户停用" value="2">
							<div class="layui-unselect layui-form-checkbox" lay-skin="primary"><span>用户停用</span><i class="layui-icon"></i></div>
						</div>
					</td>
				</tr>
				<?php endforeach; endif; else: echo "" ;endif; ?>
				</tbody>
			</table>
		</div>
		<div class="layui-form-item layui-form-text">
			<label for="desc" class="layui-form-label">
				描述
			</label>
			<div class="layui-input-block">
				<textarea placeholder="请输入内容" id="desc" name="desc" class="layui-textarea" disabled><?php echo $authRole['role_sign']; ?></textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<button class="layui-btn" lay-submit="" lay-filter="add">增加</button>
		</div>
	</form>
</div>
<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;

        //监听提交
        form.on('submit(add)', function (data) {
            console.log(data);
            //发异步，把数据提交给php
            layer.alert("增加成功", {icon: 6}, function () {
                // 获得frame索引
                var index = parent.layer.getFrameIndex(window.name);
                //关闭当前frame
                parent.layer.close(index);
            });
            return false;
        });
    });
</script>
</body>
